import { uniFetch } from './uni-fetch.js'

/**
 * 上报异常
 */
export const reportException = (data) => {
  return uniFetch({
    method: 'POST',
    url: '/driver/tasks/reportException',
    data,
  })
}

/**
 * 提货
 */
export const takeDelivery = (data) => {
  return uniFetch({
    method: 'POST',
    url: '/driver/tasks/takeDelivery',
    data,
  })
}

/**
 * 延迟任务
 */
export const taskDelay = (data) => {
  return uniFetch({
    method: 'PUT',
    url: '/driver/tasks/delay',
    data,
  })
}

/**
 * 获取任务详情
 */
export const getTaskDetail = (id) => {
  return uniFetch({
    method: 'GET',
    url: '/driver/tasks/details/' + id,
  })
}

/**
 * 获取任务列表
 */
export const getTaskList = (data) => {
  return uniFetch({
    method: 'GET',
    url: '/driver/tasks/list',
    data,
    // mock: true,
  })
}
